home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 April: Mac OS SDK / Dev.CD Apr 96 SDK / Dev.CD Apr 96 SDK1.toast / Development Kits (Disc 1) / OpenDoc Development Framework / ODFDev / ODF / OS / FWGraphx / Include / FWBndShp.h < prev    next >
Encoding:
Text File  |  1995-11-08  |  3.2 KB  |  116 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                FWBndShp.h
  4. //    Release Version:    $ 1.0d11 $
  5. //
  6. //    Copyright:    © 1993, 1995 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9.  
  10. #ifndef FWBNDSHP_H
  11. #define FWBNDSHP_H
  12.  
  13. #ifndef FWSHAPE_H
  14. #include "FWShape.h"
  15. #endif
  16.  
  17. #ifndef FWRECT_H
  18. #include "FWRect.h"
  19. #endif
  20.  
  21. #if FW_LIB_EXPORT_PRAGMAS
  22. #pragma lib_export on
  23. #endif
  24.  
  25. //========================================================================================
  26. //    Forward Declarations
  27. //========================================================================================
  28.  
  29. class FW_CLASS_ATTR ODTransform;
  30.  
  31. //========================================================================================
  32. //    class FW_CBoundedShape
  33. //========================================================================================
  34.  
  35. class FW_CLASS_ATTR FW_CBoundedShape : public FW_CShape
  36. {
  37. public:
  38.     FW_DECLARE_CLASS
  39.  
  40. //----------------------------------------------------------------------------------------
  41. //    Constructors/Destructors
  42. //
  43. protected:
  44.     FW_CBoundedShape(const FW_CRect& rect, 
  45.                      FW_ERenderVerbs renderVerb,
  46.                      const FW_PInk& ink,
  47.                      const FW_PStyle& style,
  48.                      const FW_PFont& font);
  49.  
  50.     FW_CBoundedShape(const FW_CBoundedShape& other);
  51.     FW_CBoundedShape(FW_CReadableStream& archive);
  52.     
  53.     virtual ~ FW_CBoundedShape();
  54.  
  55. //----------------------------------------------------------------------------------------
  56. //    Operators
  57. //
  58. public:
  59.     FW_CBoundedShape&     operator=(const FW_CBoundedShape& other);
  60.     
  61. //----------------------------------------------------------------------------------------
  62. //    Inherited API
  63. //
  64. public:
  65.     //----- Hit Test -----
  66.     FW_Boolean            HitTest(FW_CGraphicContext& gc,
  67.                                 const FW_CPoint& test,
  68.                                 FW_CFixed tolerance) const;
  69.  
  70.     // ----- Transform -----
  71.     virtual void        Transform(Environment *ev, ODTransform* transform);
  72.     virtual void        InverseTransform(Environment *ev, ODTransform* transform);
  73.  
  74.     virtual void        MoveShape(FW_CFixed deltaX, FW_CFixed deltaY);
  75.     virtual void        MoveShapeTo(FW_CFixed x, FW_CFixed y);
  76.  
  77.     virtual void        Inset(FW_CFixed h, FW_CFixed v);
  78.  
  79.     // ----- Bounds -----
  80.     virtual void         GetBounds(FW_CGraphicContext& gc, FW_CRect& rect) const;
  81.  
  82.     // ----- Persistence -----
  83.     virtual void        Flatten(FW_CWritableStream& archive) const;
  84.  
  85. //----------------------------------------------------------------------------------------
  86. //    New API
  87. //
  88. public:
  89.     void                GetRectangle(FW_CRect& rect) const
  90.                             {rect = fRect;}    
  91.                             
  92.     void                SetRectangle(const FW_CRect& rect)
  93.                             {fRect = rect;}
  94.                             
  95.     void                SetRectangle(FW_CFixed left, FW_CFixed top, FW_CFixed right, FW_CFixed bottom)
  96.                             {fRect.Set(left, top, right, bottom);}
  97.                             
  98.     void                SetRectangle(const FW_CPoint& topLeft, const FW_CPoint& rightBot)
  99.                             {fRect.Set(topLeft.x, topLeft.y, rightBot.x, rightBot.y);}
  100.                             
  101.     void                SetRectangle(const FW_CPoint& topLeft, FW_CFixed width, FW_CFixed height)
  102.                             {fRect.Set(topLeft, width, height);}
  103.     
  104. //----------------------------------------------------------------------------------------
  105. //    Data Members
  106. //
  107. protected:
  108.     FW_CRect            fRect;    
  109. };
  110.  
  111. #if FW_LIB_EXPORT_PRAGMAS
  112. #pragma lib_export off
  113. #endif
  114.  
  115. #endif
  116.